package com.lsqingfeng.springboot.service;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

/**
 * @className: UserService
 * @description:
 * @author: sh.Liu
 * @date: 2022-04-02 11:17
 */
@Component
public class UserService {

    public Mono getUser(ServerRequest request){
        return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN)
                .body(BodyInserters.fromValue("Hello, Zhangsan!"));
    }

    public Mono delUser(ServerRequest request){
        return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN)
                .body(BodyInserters.fromValue("bye, Zhangsan!"));
    }


}
